<?php

/*check if the session is started 
show login logout buton 
*/
$div_log = "";
$div_login ="";
$accLvl = "";
if(!isset($_SESSION['id']) || !isset($_SESSION['username']) || !isset($_SESSION['password']) || !isset($_SESSION['type'])){

$div_login .='	<div id="header_right">';
$div_login .='		<a href="signup.php">Sign up</a> &nbsp;|&nbsp; ';
$div_login .='		<a href="#" id="login">Log In</a> &nbsp; &nbsp; &nbsp; &nbsp;';
$div_login .='	</div>';
	echo $div_login;
}
else{

	if($_SESSION['type'] == 1){
		$accLvl = "admin.php";
	}
	else if($_SESSION['type'] == 3){
		$accLvl = "profile.php";
	}else{
		$accLvl = "#";
	}

$div_log .='	<div id="header_right">';
$div_log .='		<a href="'.$accLvl.'">My Account</a> | ';
$div_log .='		<a href="logout.php" id="login">Logout</a>';
$div_log .='	</div>';
	echo $div_log;
}
	


?>